package com.kgc.ljp.OutputStream;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

    import java.io.*;
    public class FileOutputStreamDemo {
        public static void main(String[] args)
                throws IOException {
            String file = "d:out.txt";
            OutputStream out = new FileOutputStream(file);
            out.write(65);//在文件中是以16进制存储的,对应0x41
            out.write(66);//0x42
            byte[] buf = {(byte)0xd6,(byte)0xd0};
            out.write(buf);
            out.flush();//刷出缓存，清理缓冲区，保证可靠写
            out.close();
        }
    }

